<!DOCTYPE html>

<html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>BOM: history</title>
    </head>
    <body>

        <p>测试 history 的 back 、go 、forward 函数</p>

        <button onclick="history.back()">Back</button>
        <button onclick="history.go(-2)">Go(-2)</button>
        <button onclick="history.go(-1)">Go(-1)</button>
        <button onclick="show()" >获取 length 和 state</button>
        <button onclick="history.go(1)">Go(1)</button>
        <button onclick="history.go(2)">Go(2)</button>
        <button onclick="history.forward()">Forward</button>

        <script type="text/javascript">
            function show(){
                console.log( history.length , history.state );
            }
        </script>
        
    </body>
</html>